﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
										xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
	<Style TargetType="{x:Type ContextMenu}" >
		<Setter Property="SnapsToDevicePixels" Value="True"/>
		<Setter Property="OverridesDefaultStyle" Value="True"/>
		<Setter Property="Grid.IsSharedSizeScope" Value="True"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ContextMenu}">
					<Border Name="Border" Background="#FFAAAAAA" Padding="0,2,0,2" BorderBrush="#FFBBBBBB" BorderThickness="1">
						<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle"/>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="HasDropShadow" Value="True">
							<Setter TargetName="Border" Property="Padding" Value="0,3,0,3"/>
							<Setter TargetName="Border" Property="CornerRadius" Value="4"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<ControlTemplate x:Key="{x:Static MenuItem.SubmenuItemTemplateKey}" TargetType="{x:Type MenuItem}">
		<Grid>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto" />
				<ColumnDefinition Width="*"/>
			</Grid.ColumnDefinitions>
			<Border x:Name="Check" Grid.Column="0" Margin="1" Width="22" Height="22" Visibility="Collapsed" Background="Transparent">
				<Path x:Name="CheckMark" Fill="#0C12A1" Visibility="Hidden" FlowDirection="LeftToRight" Width="9" Height="11" Data="M0,5.1L1.7,5.2 3.4,7.1 8,0.4 9.2,0 3.3,10.8z"/>
			</Border>
			<Border Grid.Column="1"  x:Name="menuItemBorder" Background="Transparent" Margin="0,1,0,1" >
				<ContentPresenter Name="HeaderHost" ContentSource="Header" RecognizesAccessKey="True">
					<ContentPresenter.Resources>
						<Style TargetType="TextBlock">
							<Setter Property="Foreground" Value="#FF333333"/>
							<Setter Property="Padding" Value="5,4,30,4"/>
						</Style>
					</ContentPresenter.Resources>
				</ContentPresenter>
			</Border>
		</Grid>
		<ControlTemplate.Triggers>
			<Trigger Property="IsMouseOver" Value="True">
				<Setter TargetName="menuItemBorder" Property="Background">
					<Setter.Value>
						<SolidColorBrush Color="#FF888888"/>
					</Setter.Value>
				</Setter>
			</Trigger>
			<Trigger Property="IsChecked" Value="true">
				<Setter TargetName="CheckMark" Property="Visibility" Value="Visible"/>
			</Trigger>
			<Trigger Property="IsCheckable" Value="true">
				<Setter TargetName="Check" Property="Visibility" Value="Visible"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>

	<ControlTemplate x:Key="{x:Static MenuItem.SubmenuHeaderTemplateKey}" TargetType="{x:Type MenuItem}">
		<Border x:Name="menuItemBorder" Background="Transparent" Margin="0,1,0,1">
			<Grid>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="*"/>
					<ColumnDefinition Width="20"/>
				</Grid.ColumnDefinitions>
				<TextBlock Grid.Column="0" Text="{TemplateBinding MenuItem.Header}" Foreground="#FF333333" Padding="5,4,30,4"/>
				<Path Grid.Column="1" Fill="#FF474747" Data="M0,0 L5,3 L0,6 Z" Margin="0,1,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" SnapsToDevicePixels="True"/>
				<Popup Name="Popup" Placement="Right" HorizontalOffset="-4" VerticalOffset="-5" IsOpen="{TemplateBinding IsSubmenuOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade">
					<Border Name="SubmenuBorder" SnapsToDevicePixels="True" Background="#FFAAAAAA" BorderBrush="#FFBBBBBB" BorderThickness="1" Padding="0,2,0,2">
						<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle"/>
					</Border>
				</Popup>
			</Grid>
		</Border>
		<ControlTemplate.Triggers>
			<Trigger Property="IsMouseOver" Value="True">
				<Setter TargetName="menuItemBorder" Property="Background">
					<Setter.Value>
						<SolidColorBrush Color="#FF888888"/>
					</Setter.Value>
				</Setter>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>

	<Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="{x:Type Separator}">
		<Setter Property="Margin" Value="4,1,4,1"/>
		<Setter Property="Focusable" Value="False"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate>
					<Border Background="#FF666666" Height="1" SnapsToDevicePixels="True"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>